﻿'
'

Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Data.SqlClient

Class DatabaseClass
    Private _connectionString As String = ""

    Public Sub New(ByVal connectionString As String)
        _connectionString = connectionString
    End Sub

    ''' <summary>
    ''' Check the connection with the specified connection string
    ''' </summary>
    ''' <returns>Returns True if the connection can be open else it returns False</returns>
    Public Function CheckConnection() As Boolean
        Dim con As New SqlConnection(_connectionString)
        Try
            con.Open()
            con.Close()
            Return True
        Catch ex As SqlException
            Return False
        End Try
    End Function
End Class

